package com.hippo.core.pojo.task;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * @ClassName CustomizeTask
 * @Description TODO 定时任务
 * @Author tangxl
 * @create 2023-04-28 14:11
 **/
@Data
@Slf4j
@Schema(name = "定时任务")
public class CustomizeTask implements Runnable {
    @Schema(name = "任务编码", example = "task_001")
    private String code;
    @Schema(name = "任务名称", example = "定时任务")
    private String name;
    @Schema(name = "触发条件", example = "0/5 * * * * ?")
    private String cron;

    public CustomizeTask(String code,String name, String cron) {
        this.code = code;
        this.name = name;
        this.cron = cron;
    }

    @Override
    public void run() {
        log.info("当前任务编码：{},当前任务名称：{},当前系统时间：{}", code,name, System.currentTimeMillis() );
    }
}
